# -*- coding: utf-8 -*-
"""
Created on Sat Jan  5 22:45:26 2019

@author: william

Email: hua_yan_tsn@163.com
"""

# 头文件区
import pandas as pd

# 常量区
encoding = 'gbk'
testFileName = './DataSet/sentiment-analysis-ccf-bdci/train.csv'
# 函数区
def readTrain(filename):
    """
    : filename 训练集文件路径
    : return 返回一个含有title的三元组形式的dataframe对象
    """
    file = pd.read_csv(filename, encoding = encoding)
    answer = file.iloc[:, 2:5] # title line are [subject, sentiment_value, sentiment_word]
    return answer

def readTest(filename):
    """
    : filename 测试集文件路径
    : return 返回一个含有title的dataframe对象
    """
    file = pd.read_csv(filename, encoding=encoding)
    answer = file.iloc[:, 1]
    return answer

def readSentimentEmbeddings(url):
    
    pass

def main():
    readTrain(testFileName)
    readTest(testFileName)
if __name__ == '__main__' :
    main()